package com.dys.designpattern.simplefactory.applypay.controller;

import com.dys.designpattern.simplefactory.applypay.factory.PayFactory;
import com.dys.designpattern.simplefactory.applypay.service.IPay;

/**
 * @Author: 疾风
 * @ClassName: AfterFactory
 * @Description: 使用工厂模式之后
 * @CreateDate: 2024/05/14
 * @Version: v1.0.0
 */
public class AfterFactory {

    public static void order(int payType) {
        // 根据type 调用不同的支付
        IPay order = PayFactory.order(payType);
        order.pay();
    }

    public static void main(String[] args) {
        order(1);
    }
}
